package com.open4cn.simulator.answer.xrite.x7800;

import com.open4cn.simulator.core.answer.AbstractAction;
import com.open4cn.simulator.core.ext.XriteStatus;

/**
 * @author yinxiaopeng
 * @version 1.0.0
 * @company 致景科技
 * @department 飞梭BU/研发
 * @description
 * @Email yinxiaopeng@zj.tech
 * @date 2022-07-21 18:23
 */
public class PickupSetAction extends AbstractAction {

    public PickupSetAction() {
        super(null);
    }

    public PickupSetAction(AbstractAction action) {
        super(action);
    }

    @Override
    public void action(Object... params) {
        XriteStatus xriteStatus = (XriteStatus) params[0];
        XriteStatus.LensDistanceEnum lensDistanceEnum = (XriteStatus.LensDistanceEnum) params[1];
        if (!xriteStatus.inCorrecting()) {
            xriteStatus.startCorrection();
        }
        xriteStatus.changeLensDistance(lensDistanceEnum);
        if (hasNext()) {
            action.action(params);
        }
    }
}
